<template>
  <div>
    <div class="juzho">
      <div class="shu" v-for="(item, index) in attr" :key="index">
        <div class="xiangdui">
          <div class="bgimg">
            <img :src="item.bgimg" alt="" />
          </div>
          <div class="dingwei">{{ item.name }}</div>
        </div>
        <div v-for="(item, index) in item.ziimg" :key="index">
          <div class="bgcolor">
            <img :src="item.img" alt="" />
            <p class="tit">{{ item.tit }}</p>
            <div class="logo">
              <div class="tou">
                <img :src="item.logo" alt="" />
              </div>
              <div class="wezi">
                <p>{{ item.name }}</p>
                <p>{{ item.price }}</p>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import instance from "../request/api.js";
export default {
  name: "Doman",
  data() {
    return {
      attr: null,
    };
  },
  methods: {
    async fn() {
      let { data } = await instance.get("doman");
      this.attr = data;
      console.log(data);
    },
  },
  created() {
    this.fn();
  },
};
</script>

<style scoped>
.juzho {
  width: 1496px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  justify-content: space-between;
}
.shu {
  width: 236px;
}
.bgimg {
  width: 236px;
  height: 126px;
  overflow: hidden;
  border-radius: 10px;
}
.bgimg img {
  width: 100%;
}
.xiangdui {
  position: relative;
  margin-bottom: 20px;
}
.dingwei {
  position: absolute;
  left: 5%;
  top: 0;
  width: 90%;
  height: 126px;
  line-height: 126px;
  font-size: 20px;
  color: #fff;
  text-align: center;
  text-overflow: ellipsis;
  overflow: hidden;
}
.logo{
  display: flex;
  height: 66px;
  align-items: center;
  padding: 0 16px;
}
.tou{
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  margin-right: 20px;
}
.tou img{
  width: 100%;
  height: 100%;
}
.wezi p{
  padding: 0;
  margin: 0;
  font-size: 12px;
  color: #9E7E6B;
}
.tit{
  font-size: 12px;
  margin: 0;
  color: #444;
  padding: 0 16px;
    margin: 10px 0;
}
.bgcolor{
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 20px;
}
</style>